package com.woniuxy.ticket_cinema.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.ticket_cinema.entity.Dto.ScheduleDto;
import com.woniuxy.ticket_cinema.entity.ResponseResult;
import com.woniuxy.ticket_cinema.service.ScheduleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author booty
 * @since 2021-02-22
 */
@RestController
@RequestMapping("/schedule")
public class ScheduleController {

    @Resource
    private ScheduleService scheduleService;

    //根据电影id查询排片以及电影院信息
    @GetMapping("/findScheduleDtoByFilmId")
    public ResponseResult<List<ScheduleDto>> findScheduleDtoByFilmId(Page<ScheduleDto> page, int id) {
        return new ResponseResult<List<ScheduleDto>>().success(scheduleService.findScheduleDtoByFilmId(page, id));
    }

}

